﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<WebManageUsers>" %>

<%@ Import Namespace="Common.Background.Entity" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>后台管理系统</title>
    <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            if (top.location != self.location) {
                top.location = self.location;
            }

            $('#sub_btn').click(function () {

                var res = true;
                if ($.trim($('#LoginName').val()) == '') {
                    res = false;
                    $('#LoginName_message').show();
                } else {
                    $('#LoginName_message').hide();
                }
                if ($.trim($('#Password').val()) == '') {
                    res = false;
                    $('#Password_message').show();
                } else {
                    $('#Password_message').hide();
                }
                if ($.trim($('#RandomCode').val()) == '') {
                    res = false;
                    $('#RandomCode_message').show();
                } else {
                    $('#RandomCode_message').hide();
                }
                return res;
            })
        });
    </script>
    <style type="text/css">
        .error { color: Red; font: 10px; }
        body { margin: 0px; padding: 0px; color: #fff; font-size: 14px; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 20px; background: #2a8a9f; }
        td { font-size: 14px; font-family: Verdana, Arial, Helvetica, sans-serif; padding: 4px 0; }
        .inp { width: 160px; height: 20px; line-height: 20px; }
        .inp1 { width: 80px; height: 20px; line-height: 20px; }
        form { margin: 0px; padding: 0px; }
        a { color: #fff; text-decoration: none; }
        a:hover { color: #fff; text-decoration: underline; }
        .button { color: #026075; cursor: pointer; height: 31px; border: none; font-size: 14px; line-height: 31px; text-align: center; width: 118px; background: url(http://img1.c2cedu.com/image/Backstage/images/bott.gif); }
    </style>
</head>
<body>
    <%=Html.Hidden("username",Session["Background_Current_UserName"]??"") %>
    <table cellspacing="0" cellpadding="0" style="margin-top: 130px" align="center">
        <tr>
            <td>
            </td>
            <td>
                <% using (Html.BeginForm("LogOn", "Account", FormMethod.Post, new { id = "Login_Form" }))
                   {%>
                <table style="width: 400px">
                    <tr>
                        <div id="Login_Msg" style="font: 12px; color: Red">
                            <%= Html.Encode(ViewData["Result"]) %></div>
                    </tr>
                    <tr>
                        <td align="right" style="width: 30%">
                            管理员姓名：
                        </td>
                        <td>
                            <%= Html.TextBoxFor(model => model.LoginName, new { @class = "required inp" })%>
                            <%= Html.ValidationMessageFor(model => model.LoginName) %>
                        </td>
                        <td>
                            <div id="LoginName_message" style="color: Red; display: none">
                                请输入姓名
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            管理员密码：
                        </td>
                        <td>
                            <%= Html.PasswordFor(model => model.Password, new { @class = "required inp" })%>
                            <%= Html.ValidationMessageFor(model => model.Password) %>
                        </td>
                        <td>
                            <div id="Password_message" style="color: Red; display: none">
                                请输入密码
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            验证码：
                        </td>
                        <td style="vertical-align: middle;">
                            <input type="text" maxlength="4" name="RandomCode" id="RandomCode" class="capital inp1" />
                            <img id="code_img" src="<%=Url.Action("RandomPic","Account") %>" alt="看不清？点击更换另一个验证码。"
                                style="vertical-align: bottom; height: 23px; width: 75px;" />
                        </td>
                        <td>
                            <div id="RandomCode_message" style="color: Red; display: none">
                                请输入验证码
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td align="left">
                            &nbsp;
                        </td>
                        <script type="text/javascript">
                            $('#code_img').click(function () {
                                var url = '<%=Url.Action("RandomPic","Account") %>/?r=' + Math.random() + new Date().getTime();
                                $('#code_img').attr('src', url);

                                return false;
                            });
                        </script>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <input type="submit" value="进入管理中心" class="button" id="sub_btn" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td style="font-size: 12px;">
                            <a href="#" style="color: white">返回首页</a>
                        </td>
                    </tr>
                </table> 
                <% } %>
            </td>
        </tr>
    </table>
</body>
</html>
